<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/fs.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">fs.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d8/d68/fs_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#if defined( __WIN32 ) || defined( __WIN64 ) || defined( WINNT )</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#   if defined( __GNUC__ )</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#       include &lt;dirent.h&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#   else</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#       include &lt;windows.h&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#   endif</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#elif defined( __LINUX__ )</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#   include &lt;dirent.h&gt;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#include &lt;sys/stat.h&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="preprocessor">#include &quot;<a class="code" href="../../de/dfd/tree_8hpp.html">tree.hpp</a>&quot;</span></div>
<div class="foldopen" id="foldopen00026" data-start="{" data-end="};">
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html">   26</a></span><span class="keyword">class </span><a class="code hl_class" href="../../dc/d2f/classfs.html">fs</a></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>{</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00030" data-start="{" data-end="};">
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../dc/d7c/structfs_1_1st_file_item.html">   30</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="../../dc/d7c/structfs_1_1st_file_item.html">stFileItem</a>{</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="../../dc/d7c/structfs_1_1st_file_item.html#a3f022dab7e22f728b3cb113d38ffd3cd">   31</a></span>        std::string    <a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a3f022dab7e22f728b3cb113d38ffd3cd">m_name</a>;</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"><a class="line" href="../../dc/d7c/structfs_1_1st_file_item.html#a787bbe71f8673de7e6f76058f86d527b">   32</a></span>        <span class="keyword">struct </span>stat    <a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a787bbe71f8673de7e6f76058f86d527b">m_stat</a>;</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>        </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="../../dc/d7c/structfs_1_1st_file_item.html#a63402b5f7b4c287b10764afa236de0e6">   34</a></span>        <a class="code hl_function" href="../../dc/d7c/structfs_1_1st_file_item.html#a63402b5f7b4c287b10764afa236de0e6">stFileItem</a>(){}</div>
<div class="foldopen" id="foldopen00035" data-start="{" data-end="}">
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="../../dc/d7c/structfs_1_1st_file_item.html#a3f84b3f8a4cf63b483f6770efe8d4621">   35</a></span>        <a class="code hl_function" href="../../dc/d7c/structfs_1_1st_file_item.html#a3f84b3f8a4cf63b483f6770efe8d4621">stFileItem</a>( <span class="keyword">const</span> <a class="code hl_struct" href="../../dc/d7c/structfs_1_1st_file_item.html">stFileItem</a>&amp; b ){</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>            <a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a3f022dab7e22f728b3cb113d38ffd3cd">m_name</a> = b.<a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a3f022dab7e22f728b3cb113d38ffd3cd">m_name</a>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>            memcpy( &amp;<a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a787bbe71f8673de7e6f76058f86d527b">m_stat</a> , &amp;b.<a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a787bbe71f8673de7e6f76058f86d527b">m_stat</a> , <span class="keyword">sizeof</span>( <span class="keyword">struct</span> stat ));</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>        }</div>
</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>            </div>
<div class="foldopen" id="foldopen00040" data-start="{" data-end="}">
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../dc/d7c/structfs_1_1st_file_item.html#a8b4b476a7896409275e869ab2f8710f0">   40</a></span>        <a class="code hl_struct" href="../../dc/d7c/structfs_1_1st_file_item.html">stFileItem</a>&amp; <a class="code hl_function" href="../../dc/d7c/structfs_1_1st_file_item.html#a8b4b476a7896409275e869ab2f8710f0">operator=</a>( <span class="keyword">const</span> <a class="code hl_struct" href="../../dc/d7c/structfs_1_1st_file_item.html">stFileItem</a>&amp; b ){</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>            <a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a3f022dab7e22f728b3cb113d38ffd3cd">m_name</a> = b.<a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a3f022dab7e22f728b3cb113d38ffd3cd">m_name</a>;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>            memcpy( &amp;<a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a787bbe71f8673de7e6f76058f86d527b">m_stat</a> , &amp;b.<a class="code hl_variable" href="../../dc/d7c/structfs_1_1st_file_item.html#a787bbe71f8673de7e6f76058f86d527b">m_stat</a> , <span class="keyword">sizeof</span>( <span class="keyword">struct</span> stat ));</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>            <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>        }</div>
</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>                </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    };</div>
</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#aceed8ab8a41b460ab6feafd3ffeed55e">   48</a></span>    <span class="keyword">using </span><a class="code hl_class" href="../../d4/d4d/classtree.html">fileTree</a> = <a class="code hl_class" href="../../d4/d4d/classtree.html">tree&lt; stFileItem &gt;</a>;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="foldopen" id="foldopen00050" data-start="{" data-end="};">
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">   50</a></span>    <span class="keyword">enum</span> <a class="code hl_enumeration" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">emErrCode</a>{</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49af2fb67f4a4e2714bd8fda5dbf1ce85bd">   51</a></span>        <a class="code hl_enumvalue" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49af2fb67f4a4e2714bd8fda5dbf1ce85bd">ERR_ROOT_EMPTY</a> = -1000,</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a9aed94f00d66f8f2784698c5ec480012">   52</a></span>        <a class="code hl_enumvalue" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a9aed94f00d66f8f2784698c5ec480012">ERR_MISSING_TMPT</a>,</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49aa1f1f147fb76092ddd04140a41e53e95">   53</a></span>        <a class="code hl_enumvalue" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49aa1f1f147fb76092ddd04140a41e53e95">ERR_OPEN_DIR</a>,</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a99e222bf97d360aa059a8fed65645bec">   54</a></span>        <a class="code hl_enumvalue" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a99e222bf97d360aa059a8fed65645bec">ERR_PATH_NOT_DIR</a>,</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a45e1b2274065c1887af132ced3301362">   55</a></span>        <a class="code hl_enumvalue" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a45e1b2274065c1887af132ced3301362">ERR_ITER_DIR</a>,              <span class="comment">// 遍历目录失败</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>        <a class="code hl_enumvalue" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a38fb7051ea8a8af6304601faeacf66a7">OK</a> = 0</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a38fb7051ea8a8af6304601faeacf66a7">   57</a></span>    };</div>
</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#ac371f0f306e0f01776cce4997b168a69">copy</a>( <span class="keyword">const</span> std::string&amp; from , <span class="keyword">const</span> std::string&amp; to );</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#a821cb3cdae648caf6a9f92b39c864421">isDir</a>( <span class="keyword">const</span> std::string&amp; path );</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="../../dc/d2f/classfs.html#ac798c0a9fba084f6c2ec070924828915">   73</a></span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#ac798c0a9fba084f6c2ec070924828915">isDir</a>( <span class="keyword">const</span> <a class="code hl_struct" href="../../dc/d7c/structfs_1_1st_file_item.html">stFileItem</a>&amp; item );</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#aaf164e8b33c13f8499dafa499f763778">isFile</a>( <span class="keyword">const</span> std::string&amp; path );</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#acddf6fbd688a9f3ab94f8634090ac9db">dirEmpty</a>( <span class="keyword">const</span> std::string&amp; path );</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    <span class="keyword">static</span> <a class="code hl_enumeration" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">emErrCode</a> <a class="code hl_function" href="../../dc/d2f/classfs.html#aca59d4eca486930e503c0e6902ae591c">enumFile</a>( <span class="keyword">const</span> std::string&amp; path , <a class="code hl_class" href="../../d4/d4d/classtree.html">fileTree</a>&amp; root );</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#aead05250d375e2339c7b9d5d9181d01c">enumFileAsync</a>( <span class="keyword">const</span> std::string&amp; path , std::function&lt; <span class="keywordtype">void</span> ( <a class="code hl_enumeration" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">emErrCode</a> , <a class="code hl_class" href="../../d4/d4d/classtree.html">fileTree</a>&amp; ) &gt; fun );</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span>    <span class="keyword">static</span> <a class="code hl_enumeration" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">emErrCode</a> <a class="code hl_function" href="../../dc/d2f/classfs.html#aadd2e9ee5179b644dac3206cdd662f34">removeFile</a>( <span class="keyword">const</span> std::string&amp; path ,</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>                     <span class="keyword">const</span> std::string&amp; reg , <span class="keywordtype">bool</span> re = <span class="keyword">true</span> );</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dc/d2f/classfs.html#a0a07c998d2fa4da5920d39421123dba0">removeFileAsync</a>( <span class="keyword">const</span> std::string&amp; path,</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>                      <span class="keyword">const</span> std::string&amp; files ,</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>                      std::function&lt; <span class="keywordtype">void</span> (<a class="code hl_enumeration" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">emErrCode</a>) &gt; fun,</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>                      <span class="keywordtype">bool</span> re = <span class="keyword">true</span> );</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>    <span class="keyword">static</span> <a class="code hl_enumeration" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">emErrCode</a> <a class="code hl_function" href="../../dc/d2f/classfs.html#a13278749ac0f2cf238be3829c3b7f68d">for_each</a>( <span class="keyword">const</span> std::string&amp; path , std::function&lt; <span class="keywordtype">bool</span> ( <a class="code hl_enumeration" href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">emErrCode</a> , <span class="keyword">const</span> <a class="code hl_struct" href="../../dc/d7c/structfs_1_1st_file_item.html">stFileItem</a>&amp; ) &gt; fun );</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>};</div>
</div>
<div class="ttc" id="aclassfs_html"><div class="ttname"><a href="../../dc/d2f/classfs.html">fs</a></div><div class="ttdoc">文件系统接口封装</div><div class="ttdef"><b>定义</b> <a href="#l00026">fs.hpp:27</a></div></div>
<div class="ttc" id="aclassfs_html_a0a07c998d2fa4da5920d39421123dba0"><div class="ttname"><a href="../../dc/d2f/classfs.html#a0a07c998d2fa4da5920d39421123dba0">fs::removeFileAsync</a></div><div class="ttdeci">static void removeFileAsync(const std::string &amp;path, const std::string &amp;files, std::function&lt; void(emErrCode) &gt; fun, bool re=true)</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00292">fs.cpp:292</a></div></div>
<div class="ttc" id="aclassfs_html_a13278749ac0f2cf238be3829c3b7f68d"><div class="ttname"><a href="../../dc/d2f/classfs.html#a13278749ac0f2cf238be3829c3b7f68d">fs::for_each</a></div><div class="ttdeci">static emErrCode for_each(const std::string &amp;path, std::function&lt; bool(emErrCode, const stFileItem &amp;) &gt; fun)</div><div class="ttdoc">遍历指定路径中的文件</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00308">fs.cpp:308</a></div></div>
<div class="ttc" id="aclassfs_html_a821cb3cdae648caf6a9f92b39c864421"><div class="ttname"><a href="../../dc/d2f/classfs.html#a821cb3cdae648caf6a9f92b39c864421">fs::isDir</a></div><div class="ttdeci">static bool isDir(const std::string &amp;path)</div><div class="ttdoc">判断给定的路径是否是目录</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00075">fs.cpp:75</a></div></div>
<div class="ttc" id="aclassfs_html_aadd2e9ee5179b644dac3206cdd662f34"><div class="ttname"><a href="../../dc/d2f/classfs.html#aadd2e9ee5179b644dac3206cdd662f34">fs::removeFile</a></div><div class="ttdeci">static emErrCode removeFile(const std::string &amp;path, const std::string &amp;reg, bool re=true)</div><div class="ttdoc">删除满足条件要求的文件或者目录</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00206">fs.cpp:206</a></div></div>
<div class="ttc" id="aclassfs_html_aaf164e8b33c13f8499dafa499f763778"><div class="ttname"><a href="../../dc/d2f/classfs.html#aaf164e8b33c13f8499dafa499f763778">fs::isFile</a></div><div class="ttdeci">static bool isFile(const std::string &amp;path)</div><div class="ttdoc">判断给定的路径是否是普通文件</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00097">fs.cpp:97</a></div></div>
<div class="ttc" id="aclassfs_html_ac371f0f306e0f01776cce4997b168a69"><div class="ttname"><a href="../../dc/d2f/classfs.html#ac371f0f306e0f01776cce4997b168a69">fs::copy</a></div><div class="ttdeci">static bool copy(const std::string &amp;from, const std::string &amp;to)</div><div class="ttdoc">拷贝文件</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00057">fs.cpp:57</a></div></div>
<div class="ttc" id="aclassfs_html_ac798c0a9fba084f6c2ec070924828915"><div class="ttname"><a href="../../dc/d2f/classfs.html#ac798c0a9fba084f6c2ec070924828915">fs::isDir</a></div><div class="ttdeci">static bool isDir(const stFileItem &amp;item)</div></div>
<div class="ttc" id="aclassfs_html_aca59d4eca486930e503c0e6902ae591c"><div class="ttname"><a href="../../dc/d2f/classfs.html#aca59d4eca486930e503c0e6902ae591c">fs::enumFile</a></div><div class="ttdeci">static emErrCode enumFile(const std::string &amp;path, fileTree &amp;root)</div><div class="ttdoc">枚举文件，将指定目录按照原本的结构整理成一个可以以树形结构遍历的数据</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00120">fs.cpp:120</a></div></div>
<div class="ttc" id="aclassfs_html_acddf6fbd688a9f3ab94f8634090ac9db"><div class="ttname"><a href="../../dc/d2f/classfs.html#acddf6fbd688a9f3ab94f8634090ac9db">fs::dirEmpty</a></div><div class="ttdeci">static bool dirEmpty(const std::string &amp;path)</div><div class="ttdoc">判断指定目录是否是空目录</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00018">fs.cpp:18</a></div></div>
<div class="ttc" id="aclassfs_html_aead05250d375e2339c7b9d5d9181d01c"><div class="ttname"><a href="../../dc/d2f/classfs.html#aead05250d375e2339c7b9d5d9181d01c">fs::enumFileAsync</a></div><div class="ttdeci">static void enumFileAsync(const std::string &amp;path, std::function&lt; void(emErrCode, fileTree &amp;) &gt; fun)</div><div class="ttdef"><b>定义</b> <a href="../../d3/d58/fs_8cpp_source.html#l00191">fs.cpp:191</a></div></div>
<div class="ttc" id="aclassfs_html_af8aecc9593fcc171457f88a3c7c35e49"><div class="ttname"><a href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49">fs::emErrCode</a></div><div class="ttdeci">emErrCode</div><div class="ttdef"><b>定义</b> <a href="#l00050">fs.hpp:50</a></div></div>
<div class="ttc" id="aclassfs_html_af8aecc9593fcc171457f88a3c7c35e49a38fb7051ea8a8af6304601faeacf66a7"><div class="ttname"><a href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a38fb7051ea8a8af6304601faeacf66a7">fs::OK</a></div><div class="ttdeci">@ OK</div><div class="ttdef"><b>定义</b> <a href="#l00057">fs.hpp:56</a></div></div>
<div class="ttc" id="aclassfs_html_af8aecc9593fcc171457f88a3c7c35e49a45e1b2274065c1887af132ced3301362"><div class="ttname"><a href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a45e1b2274065c1887af132ced3301362">fs::ERR_ITER_DIR</a></div><div class="ttdeci">@ ERR_ITER_DIR</div><div class="ttdef"><b>定义</b> <a href="#l00055">fs.hpp:55</a></div></div>
<div class="ttc" id="aclassfs_html_af8aecc9593fcc171457f88a3c7c35e49a99e222bf97d360aa059a8fed65645bec"><div class="ttname"><a href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a99e222bf97d360aa059a8fed65645bec">fs::ERR_PATH_NOT_DIR</a></div><div class="ttdeci">@ ERR_PATH_NOT_DIR</div><div class="ttdef"><b>定义</b> <a href="#l00054">fs.hpp:54</a></div></div>
<div class="ttc" id="aclassfs_html_af8aecc9593fcc171457f88a3c7c35e49a9aed94f00d66f8f2784698c5ec480012"><div class="ttname"><a href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49a9aed94f00d66f8f2784698c5ec480012">fs::ERR_MISSING_TMPT</a></div><div class="ttdeci">@ ERR_MISSING_TMPT</div><div class="ttdef"><b>定义</b> <a href="#l00052">fs.hpp:52</a></div></div>
<div class="ttc" id="aclassfs_html_af8aecc9593fcc171457f88a3c7c35e49aa1f1f147fb76092ddd04140a41e53e95"><div class="ttname"><a href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49aa1f1f147fb76092ddd04140a41e53e95">fs::ERR_OPEN_DIR</a></div><div class="ttdeci">@ ERR_OPEN_DIR</div><div class="ttdef"><b>定义</b> <a href="#l00053">fs.hpp:53</a></div></div>
<div class="ttc" id="aclassfs_html_af8aecc9593fcc171457f88a3c7c35e49af2fb67f4a4e2714bd8fda5dbf1ce85bd"><div class="ttname"><a href="../../dc/d2f/classfs.html#af8aecc9593fcc171457f88a3c7c35e49af2fb67f4a4e2714bd8fda5dbf1ce85bd">fs::ERR_ROOT_EMPTY</a></div><div class="ttdeci">@ ERR_ROOT_EMPTY</div><div class="ttdef"><b>定义</b> <a href="#l00051">fs.hpp:51</a></div></div>
<div class="ttc" id="aclasstree_html"><div class="ttname"><a href="../../d4/d4d/classtree.html">tree</a></div><div class="ttdoc">在TRP-CRM中大量的数据处理需要使用树形结构表，如BOM表，部门结构表，项目任务计划表等。</div><div class="ttdef"><b>定义</b> <a href="../../de/dfd/tree_8hpp_source.html#l00027">tree.hpp:28</a></div></div>
<div class="ttc" id="astructfs_1_1st_file_item_html"><div class="ttname"><a href="../../dc/d7c/structfs_1_1st_file_item.html">fs::stFileItem</a></div><div class="ttdoc">定义文件描述项目</div><div class="ttdef"><b>定义</b> <a href="#l00030">fs.hpp:30</a></div></div>
<div class="ttc" id="astructfs_1_1st_file_item_html_a3f022dab7e22f728b3cb113d38ffd3cd"><div class="ttname"><a href="../../dc/d7c/structfs_1_1st_file_item.html#a3f022dab7e22f728b3cb113d38ffd3cd">fs::stFileItem::m_name</a></div><div class="ttdeci">std::string m_name</div><div class="ttdef"><b>定义</b> <a href="#l00031">fs.hpp:31</a></div></div>
<div class="ttc" id="astructfs_1_1st_file_item_html_a3f84b3f8a4cf63b483f6770efe8d4621"><div class="ttname"><a href="../../dc/d7c/structfs_1_1st_file_item.html#a3f84b3f8a4cf63b483f6770efe8d4621">fs::stFileItem::stFileItem</a></div><div class="ttdeci">stFileItem(const stFileItem &amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00035">fs.hpp:35</a></div></div>
<div class="ttc" id="astructfs_1_1st_file_item_html_a63402b5f7b4c287b10764afa236de0e6"><div class="ttname"><a href="../../dc/d7c/structfs_1_1st_file_item.html#a63402b5f7b4c287b10764afa236de0e6">fs::stFileItem::stFileItem</a></div><div class="ttdeci">stFileItem()</div><div class="ttdef"><b>定义</b> <a href="#l00034">fs.hpp:34</a></div></div>
<div class="ttc" id="astructfs_1_1st_file_item_html_a787bbe71f8673de7e6f76058f86d527b"><div class="ttname"><a href="../../dc/d7c/structfs_1_1st_file_item.html#a787bbe71f8673de7e6f76058f86d527b">fs::stFileItem::m_stat</a></div><div class="ttdeci">struct stat m_stat</div><div class="ttdef"><b>定义</b> <a href="#l00032">fs.hpp:32</a></div></div>
<div class="ttc" id="astructfs_1_1st_file_item_html_a8b4b476a7896409275e869ab2f8710f0"><div class="ttname"><a href="../../dc/d7c/structfs_1_1st_file_item.html#a8b4b476a7896409275e869ab2f8710f0">fs::stFileItem::operator=</a></div><div class="ttdeci">stFileItem &amp; operator=(const stFileItem &amp;b)</div><div class="ttdef"><b>定义</b> <a href="#l00040">fs.hpp:40</a></div></div>
<div class="ttc" id="atree_8hpp_html"><div class="ttname"><a href="../../de/dfd/tree_8hpp.html">tree.hpp</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
